﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Toolbelt.ComponentModel.DataAnnotations.Schema;

namespace HCD.Entities
{
    [Table("HIS_OPERATION")]
    public class HisOperation : Entity<long>
    {
        /// <summary>
        /// 病人标识号
        /// </summary>
        [Column("PATIENT_ID", TypeName = "VARCHAR(60)"), Required, Index("INDEX_HIS_OPERATION", 1, IsUnique = true)]
        public string PatientId { get; set; }

        /// <summary>
        /// 病人本次住院标识
        /// </summary>
        [Column("VISIT_ID", TypeName = "VARCHAR(60)"), Required, Index("INDEX_HIS_OPERATION", 2, IsUnique = true)]
        public string VisitId { get; set; }

        /// <summary>
        /// 手术安排标识
        /// </summary>
        [Column("OPERATION_ID", TypeName = "VARCHAR(20)"), Required, Index("INDEX_HIS_OPERATION", 3, IsUnique = true)]
        public string OperationId { get; set; }

        /// <summary>
        /// 病人所在科室
        /// </summary>
        [Column("DEPT_STAYED", TypeName = "VARCHAR(20)")]
        public string DeptStayed { get; set; }

        /// <summary>
        /// 病人所在床号
        /// </summary>
        [Column("BED_NO", TypeName = "INT")]
        public int? BedNo { get; set; }

        /// <summary>
        /// 术前主要诊断
        /// </summary>
        [Column("DIAG_BEFORE_OPERATION", TypeName = "VARCHAR(80)")]
        public string DiagBeforeOperation { get; set; }

        /// <summary>
        /// 手术代码
        /// </summary>
        [Column("OPERATION_CODE", TypeName = "VARCHAR(50)"), Required]
        public string OperationCode { get; set; }

        /// <summary>
        /// 手术名称
        /// </summary>
        [Column("OPERATION_NAME", TypeName = "VARCHAR(80)"), Required]
        public string OperationName { get; set; }

        /// <summary>
        /// 手术等级
        /// </summary>
        [Column("OPERATION_SCALE", TypeName = "VARCHAR(4)")]
        public string OperationScale { get; set; }

        /// <summary>
        /// 申请日期及时间
        /// </summary>
        [Column("REQ_DATE_TIME", TypeName = "DATETIME")]
        public DateTime ReqDateTime { get; set; }

        /// <summary>
        /// 手术日期及时间
        /// </summary>
        [Column("SCHEDULED_DATE_TIME", TypeName = "DATETIME")]
        public DateTime? ScheduledDateTime { get; set; }

        /// <summary>
        /// 手术状态( 0 申请中 1 已安排 2 手术完成 3手术取消)
        /// </summary>
        [Column("OPERATION_STATUS", TypeName = "VARCHAR(1)"), Required]
        public string OperationStatus { get; set; }
    }
}
